﻿-var folders = ViewData["folders"] as IQueryable<KBFolder>
-if((ViewData["user"] as User).HasPermission("kbadmin"))
  =HTMLHelper.HiddenInput("canedit","true")
%ul.tree
  -foreach(var f in folders)
    %li.tn{id=string.Format("node_{0}",f.Id)}
      .node
        -if(f.KBFolders.Any())
          %a.nodeicon{href=string.Format("kb.ivp/view/{0}",f.Id),target="kb",onclick=string.Format("return expand({0})",f.Id)}
            %img.icon16{src="img/tree/plus.gif"}
        -else
          %a.nodeicon{href="#",onclick="return false;"}
            %img.icon16{src="img/_.gif"}
        %a.link{href=string.Format("kb.ivp/view/{0}",f.Id),target="kb",onclick="return select(this)",nodeid=f.Id,path=f.Path,breadcrumbs=HTMLHelper.EscapeQuotes(f.Breadcrumbs)}
          %img.icon16{src="img/book.png"}
          %span.normal=f.Name
          -if((ViewData["user"] as User).HasPermission("kbadmin"))
            %span.hover.cm{href="#"}